Creating a Custom Class |
|
A custom class can be either a pure custom class, a derived custom class, or an inherited custom class. Each type of class is created in a different way, using different options that are available. However, the procedure for creating a custom class is common for all the three types.
- Double-click (<WS-AppServer Package>) from either of the following locations:
- Workspace Documents (My Recent Documents) window.
- Workspace Documents (Explorer)> <solution> > <project>. The WS-AppServer Package window appears, displaying the data models and their corresponding attributes, methods, and relations.
- On the WS-AppServer Package toolbar, click . The Create Class from Object Layout dialog box appears.
- On the Layout Tree tab, in the Class/Attribute Information box, provide a name for the class and fill other details.
- In the Class Layout box, right-click the <root class> and do the following:
- To add a class within, select Add > Class, and provide a name for it when prompted. Subsequently, in the Class/Attribute Information box, provide other details to define the class.
- To add an attribute within, select Add > Attribute, and provide a name for it when prompted. Subsequently, in the Class/Attribute Information box, provide other details to define the attribute. The object layout is formed in the tree structure.
Note: Depending upon your business logic requirements, you can add as many number of classes and attributes to the root class.
Tip: You can view the object layout in XML on the Layout XML tab. You can also modify the XML structure there and see the changes reflecting in the tree layout.
- Click Create.
The custom class is created under the Models group box, bearing the icon next to it.After you complete this task:
Select the custom class that you created and generate Java code and Web service operations for it.
If you need to modify the Custom class, right-click the class in Models group box and select Edit Object Layout. The Object Layout Editor appears, displaying the XML structure on the Layout XML tab.
If you need to delete a Custom class, right-click the class in Models group box and select Delete.